<template>
	<view class="page flex-col">
		<cu-custom bgColor="bg-gradual-red" :isBack="true">
			<block slot="content">我的竞拍列表</block>
		</cu-custom>
		<empty v-if="auctionbiddinglistData.length == 0"></empty>
		<view class="section1 flex-col">
			<view class="Body flex-col">
				<view class="bd2 flex-col justify-between">
					<view class="box3 flex-col">
						<view class="group1 flex-col" v-for="(item, index1) in auctionbiddinglistData" :key="index1" @click="godetail(item,0)">
							<view class="groptitle" @click.stop="godetail(item,1)">
								{{item.auctionName}}
								<uni-icons type="redo" size="30"></uni-icons>
							</view>
							<view class="outer1 flex-row justify-between">
								<view class="box4 flex-col">
									<image class="box5" :src="$getFileAccessHttpUrl(item.icon)"
										mode="aspectFill"></image>
								</view>
								<view class="box6 flex-col  justify-between">
									<view class="TextGroup1 flex-col">
										<view class="txt2">{{item.title}}</view>
										<!-- <view class="wordbox">
											<view class="word3">报名费：</view>
											<view class="word1">{{item.applyCost}}
											</view>
											<view class="word3 margin-left">保证金：
											</view>
											<view class="word1">
												{{item.earnestMoney}}</view>
										</view>	 -->	
										<view class="wordbox" v-if="item.status == 1">
											<view class="word3">起拍价：</view>
											<view class="word1">{{item.currentPrice}}</view>
										</view>
										<view class="wordbox" v-if="item.status == 2 || item.status == 5">
											<view class="word3">当前价：</view>
											<view class="word1">{{item.currentPrice}}</view>
										</view>	
										<view class="wordbox" v-if="item.status == 2 || item.status == 5">
											<view class="word3">我的最高出价：</view>
											<view class="word1">{{item.money}}</view>
											<view class="word2">{{item.biddingStatusText}}</view>
										</view>
										<view class="wordbox" v-if="item.status == 3">
											<view class="word3">成交价：</view>
											<view class="word1">{{item.currentPrice}}</view>
										</view>	
										<view class="wordbox" v-if="item.status == 3">
											<view class="word3">我的最高出价：</view>
											<view class="word1">{{item.money}}</view>
											<view class="word2">{{item.biddingStatusText}}</view>
										</view>									
										<view class="timeout">
											<view class="outer2 flex-col">
												<view class="word5">{{item.statusText}}</view>
											</view>
										</view>
										<!-- <view class="timeout">
											<view class="baozhenj">{{item.statusText}}</view>
											<view class="Pay">已缴纳</view>
										</view>	 -->							        
									</view>
								</view>
							</view>
		
						</view>
						<view class="loadingType">{{loadingType == true ?'没有更多数据了!' : '上拉显示更多'}}</view>
					</view>
				</view>
			</view>
		
		</view>
	</view>

</template>

<script>
	import server from '@/api/server.js'
	export default {
		props: {
		},
		data() {
			return {
				loadingType: false,
				tabIndex: 0, // 选中的
				auctionbiddinglistData:[],
				list:[
					{
							lanhuBg3: 'url(/static/home/128/wenan.png) -5px -47px no-repeat',
							lanhutext0: '中捷通信拍卖会（中国书画）80*100cm宣纸书法',
							lanhutext1: '¥689',
							lanhutext2: '500次出价',
							lanhutext3: '当前价：',
							lanhutext4: '剩5天17时6分49秒',
							lanhuBg7: 'url(https://lanhu.oss-cn-beijing.aliyuncs.com/psa73g8kkljp6erfkwqgk8y7y901ngjw3za41f9f016-d3ea-4e4e-8bcb-cecf0d294b35) 100% no-repeat',
							lanhutext5: '未开始',
						},
						{
							lanhuBg3: 'url(/static/home/128/wenan.png) -5px -47px no-repeat',
							lanhutext0: '中捷通信拍卖会（中国书画）80*100cm宣纸书法',
							lanhutext1: '¥689',
							lanhutext2: '500次出价',
							lanhutext3: '当前价：',
							lanhutext4: '剩5天17时6分49秒',
							lanhuBg7: 'url(https://lanhu.oss-cn-beijing.aliyuncs.com/psfq0ykot2u78cy4asd5oq9pzkq6f54ss6b21266f-d276-41a9-8592-bed58cdf0152) 100% no-repeat',
							lanhutext5: '未开始',
						},
						{
							lanhuBg3: 'url(/static/home/128/wenan.png) -5px -47px no-repeat',
							lanhutext0: '中捷通信拍卖会（中国书画）80*100cm宣纸书法',
							lanhutext1: '¥689',
							lanhutext2: '500次出价',
							lanhutext3: '当前价：',
							lanhutext4: '剩5天17时6分49秒',
							lanhuBg7: 'url(https://lanhu.oss-cn-beijing.aliyuncs.com/ps8r8mmefgaxxhc6f83gfm2b2va46vys027e971e0c9-4bb2-4c9b-9199-b741ba1231f8) 100% no-repeat',
							lanhutext5: '未开始',
						},
						{
							lanhuBg3: 'url(/static/home/128/wenan.png) -5px -47px no-repeat',
							lanhutext0: '中捷通信拍卖会（中国书画）80*100cm宣纸书法',
							lanhutext1: '¥689',
							lanhutext2: '500次出价',
							lanhutext3: '当前价：',
							lanhutext4: '剩5天17时6分49秒',
							lanhuBg7: 'url(https://lanhu.oss-cn-beijing.aliyuncs.com/psb4t2tq46hihptk1hyf0uxd709oaya96q258f4649-cba9-4a54-b164-909f5db5d9c7) 100% no-repeat',
							lanhutext5: '未开始',
						},
						{
							lanhuBg3: 'url(/static/home/128/wenan.png) -5px -47px no-repeat',
							lanhutext0: '中捷通信拍卖会（中国书画）80*100cm宣纸书法',
							lanhutext1: '¥689',
							lanhutext2: '500次出价',
							lanhutext3: '当前价：',
							lanhutext4: '剩5天17时6分49秒',
							lanhuBg7: 'url(https://lanhu.oss-cn-beijing.aliyuncs.com/psb1bnddme24whpm5fuu7z8qog8ssbxpaq701fefa5-318f-4237-8b48-33d74544a25d) 0px -1px no-repeat',
							lanhutext5: '未开始',
						},
				],
				params: {
					pageNo: 1,
					pageSize: 10,
				},
			};
		},
		onLoad: function() {

		},
		//在.js文件中监听下拉触底
		onReachBottom:function(){
			if(!this.loadingType){
				this.apiauctionpage() 
			}
		}, 
		mounted() {
			this.apiauctionpage()
		},
		computed: {

		},
		methods: {
			//列表
			apiauctionpage(){
				var that = this
				server.auctionbiddinglist(this.params).then(res => {
					console.log(res)
					if (res.data.success) {
						if (res.data.result.records.length != 10) { //没有数据
							this.loadingType = true;
						}
						this.params.pageNo++; //每触底一次 page +1
						console.log('params',this.params)
						this.auctionbiddinglistData = this.auctionbiddinglistData.concat(res.data.result.records); //将数据拼接在一起
					}
				})
			},
			godetail(item,index) {
				console.log('item',item)
				if(index == 0){
					uni.navigateTo({
						url: '/page_myauction/subjectdetail/subjectdetail?id=' + item.auctionItemId + '&auctionId=' + item.auctionId
						
					})	
				}else{
					uni.navigateTo({
						url: '/page_myauction/myauction/myauctionDetail?auctionId=' + item.auctionId
					})
				}
				
			},
			tabtap(index) {
				this.tabIndex = index;
			},
		},

		beforeDestroy() {

		},
	}
</script>

<style scoped lang="scss">
.word2{
    width: auto;
	height: auto;
	line-height: unset;
    margin-left: 10px;
    border: 1px solid #B81D22;
        color: #B81D22;
        padding: 0 4px;
        font-size: 11px;
        font-weight: bold;
        margin-right: 5px;
}
</style>
